package host.skiree.nettydemo.client.service.impl;

import host.skiree.nettydemo.client.service.MessageClientHandler;
import host.skiree.nettydemo.message.Message;
import host.skiree.nettydemo.message.UserListResponseMessage;
import io.netty.channel.ChannelHandlerContext;

/**
 * @author gcl
 * @date 2022/9/20 13:55
 */
public class UserList implements MessageClientHandler {
    @Override
    public void handleMessage(ChannelHandlerContext ctx, Message message) {
        UserListResponseMessage userListResponseMessage = (UserListResponseMessage) message;
        System.out.printf("当前在线用户 : %s\n", String.join(", ", userListResponseMessage.getUsers()) );
    }
}
